using a transistor as a switch